<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html ;charset=utf-8"/>
    <meta name="google" content="notranslate" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="description" content="EAI交易圈" />
    <meta name="keywords" content="策略,订阅,充值,外汇,金属,原油,指数,数据" />
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="shortcut icon" type="image/x-icon" href="{{URL::asset('handan/images/logo-icon.png')}}" />
    <title>段位榜</title>
    <link rel="stylesheet" href="{{URL::asset('/ucenter/css/bootstrap.min.css')}}">
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('public_css/base.css') }}" />
    <!-- 公共的css -->
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('newmaster/css/qianlibang.css') }}" />
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('newmaster/css/newselect.css') }}" />
    <!-- 自己的css -->
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('newmaster/css/duanweibang.css') }}" />
    <link rel="stylesheet" type="text/css" href="{{ URL::asset('newmaster/css/liebiao.css') }}" />
    <script type="text/javascript" src="{{ URL::asset('public_js/jquery-1.8.3.min.js') }}"></script>
    <script src="{{ URL::asset('js/layer/layer.js') }}"></script>
</head>
<body>
    @include('new.newheader')
    @include('new.newbdlistsleft')
    <div class="L_right">
        <!-- 总收益曲线图 -->
        <div class="L_profitChart">
            @include('new.allprofit')
        </div>
        <div class="L_title">
            <p>段位榜</p>
            <p>您可以在这里看到所有在EAI认证的大师</p>
        </div>
        <!-- 筛选区域 -->
        <div class="L_SX">
            <div class="L_SX_T">
                <div class="SX_left">
                    <span></span>
                    <span></span>
                </div>
                <div class="SX_right">
                    <form id="search-form" action="{{ url('duanweibang') }}" method="get" style="display: inline-block;">
                        <input type="text" placeholder="请输入分析师名称" name="searchname" value="{{$searchname}}">
                        <input type="hidden"  name="pagecanshu" value="{{$pagecanshu}}">
                        <span onclick="event.preventDefault();document.getElementById('search-form').submit();">搜索</span>
                    </form>
                </div>
            </div>
            <!-- 筛选的内容 -->
            <div class="L_SX_con">
                <ul style="display: none;">
                    <li>
                        <span>分析师</span>
                        <span>段位</span>
                        <span>胜率</span>
                        <span>单均</span>
                        <span>总单量</span>
                        <span>近一月单量</span>
                        <span>操作</span>
                    </li>
                    @foreach ($list as $key=>$val)
                    <li>
                        <span>
                            <b>
                               <img src="@if($val->photo) {{ $val->photo}} @else {{ URL::asset('ucenter/images/head.png')}} @endif" alt="">
                            </b>
                            <div>
                                <p>{{$val->username}}</p>
                                <p style="line-height: 0px;"><img src="@if($val->authstatus == 2) {{ URL::asset('/images/vip@greatmaster.png') }} @else {{ URL::asset('/images/vip@tomorrow.png') }} @endif" alt=""></p>
                            </div>
                        </span>
                        <span>
                            <img src="@if($val->grade == '4') {{ URL::asset('index/images/Platinum.png')}} @elseif($val->grade == '3') {{ URL::asset('index/images/gold.png')}} @elseif($val->grade == '2') {{ URL::asset('index/images/silver.png')}} @elseif($val->grade == '1') {{ URL::asset('index/images/copper.png')}} @else {{ URL::asset('index/images/tie.png')}} @endif" alt="">
                            @if($val->grade == '4') 金融宗师
                            @elseif($val->grade == '3') 操盘大师
                            @elseif($val->grade == '2') 分析专家
                            @elseif($val->grade == '1') 交易高手
                            @else 交易能手
                            @endif
                        </span>
                        <span style="color: #fa4949;">{{round($val->winrate,2)}}%</span>  <!--  胜率-->
                        <span style="color: #fa4949;">{{round($val->single_final_point,2)}}</span> <!-- 单均 -->
                        <span>{{$val->ordernum}}</span> <!-- 总单量 -->
                        <span>{{$val->monthordernum}}</span> <!--近一月单量 -->
                        @if($val->id == session('eai')['id'])
                            {{--我看我自己--}}
                        @elseif($val->status == 1) {{--已订阅--}}
                        <span onclick="subfollow(this)" analyst_id="{{$val->id}}" analyst_username="{{$val->username}}" status="{{$val->status}}" direction="{{$val->direction}}">
                        <b>
                            编辑订阅
                        </b>
                    </span>
                        @else
                            <span onclick="subfollow(this)" analyst_id="{{$val->id}}" analyst_username="{{$val->username}}" status="3" direction="3">
                        <b >订阅</b>
                    </span>
                        @endif
                    </li>
                    @endforeach
                </ul>
                <ul>
                    @foreach ($list as $key=>$val)
                    <li>
                        <div class="info clearfix">
                            <div class="photo"><img src="@if($val->photo) {{ $val->photo}} @else {{ URL::asset('ucenter/images/head.png')}} @endif" alt=""></div>
                            <div class="name">
                                <p>{{$val->username}}</p>
                                <p><img src="@if($val->authstatus == 2) {{ URL::asset('/images/vip@greatmaster.png') }} @else {{ URL::asset('/images/vip@tomorrow.png') }} @endif" alt=""></p>
                            </div>
                            @if($val->id == session('eai')['id'])
                                {{--我看我自己--}}
                            @elseif($val->status == 1) {{--已订阅--}}
                            <div class="dyBtn" onclick="subfollow(this)"  analyst_id="{{$val->id}}" analyst_username="{{$val->username}}" status="{{$val->status}}" direction="{{$val->direction}}">编辑订阅</div>
                            @else
                                <div class="dyBtn"  onclick="subfollow(this)" analyst_id="{{$val->id}}" analyst_username="{{$val->username}}" status="3" direction="3">订阅</div>
                            @endif
                        </div>
                        <div class="duanweiNum">
                            <span>
                                <img src="@if($val->grade == '4') {{ URL::asset('index/images/Platinum.png')}} @elseif($val->grade == '3') {{ URL::asset('index/images/gold.png')}} @elseif($val->grade == '2') {{ URL::asset('index/images/silver.png')}} @elseif($val->grade == '1') {{ URL::asset('index/images/copper.png')}} @else {{ URL::asset('index/images/tie.png')}} @endif" alt="">
                            </span>
                            <span>
                                @if($val->grade == '4') 金融宗师
                                @elseif($val->grade == '3') 操盘大师
                                @elseif($val->grade == '2') 分析专家
                                @elseif($val->grade == '1') 交易高手
                                @else 交易能手
                                @endif
                            </span>
                        </div>
                        <div class="numList">
                            <div>
                                <p class="ffcolor">{{round($val->winrate,2)}}%</p>
                                <p class="f94color">胜率</p>
                            </div>
                            <div>
                                <p class="ffcolor">{{round($val->single_final_point,2)}}</p>
                                <p class="f94color">单均</p>
                            </div>
                            <div>
                                <p class="ffcolor">{{$val->ordernum}}</p>
                                <p class="f94color">总单量</p>
                            </div>
                        </div>
                        <div class="monthNum clearfix">
                            <span>近一月单量</span>
                            <span>{{$val->monthordernum}}</span>
                        </div>
                    </li>
                    @endforeach
                </ul>
                <br style="clear: both;">
                <!-- 分页 -->
                <div class="page">
                    {{--{{ $list->appends(['searchname' => $searchname,'grade' => $grade,'bdtype' => $bdtype,'type' => $type,'pagecanshu' => $pagecanshu])->links() }}--}}
                    @if($list->currentPage() != 1 && $list->currentPage() != 0)
                        <a href="javascript:void(0)" onclick='gotopage(0)' style="background-color:#3b9ce0">上一页</a>
                    @else
                        <a href="javascript:void(0)" style="background-color:#c2c4c9">上一页</a>
                    @endif
                    <span>第<span style="color:#3b9ce0">{{ $list->currentPage() }}</span>页</span>

                    @if($list->currentPage() != $list->lastPage() && $list->currentPage()<$list->lastPage())
                        <a href="javascript:void(0)"  onclick='gotopage(1)' style="background-color:#3b9ce0">下一页</a>
                    @else
                        <a href="javascript:void(0)" style="background-color:#c2c4c9">下一页</a>
                    @endif
                    <span>共  {{$list->total()}} 条记录</span>
                    <span>共 {{ $list->lastPage() }} 页</span>
                </div>
            </div>
        </div>
    </div>
    @include('bangdan.eject');
</body>
</html>
<script>
    var searchname = "{{$searchname}}",
            pagecanshu = '{{$pagecanshu}}';
    $('.SX_left > span').click(function(){
        var index = $(this).index();
        index == 0 ? $(this).css({'background-image':'url("../newmaster/images/liebiao.png")','backgroundColor': '#1d2433'}).siblings('span').css({'background-image':'url("../newmaster/images/tubiao.png")','backgroundColor': '#233044'}) : $(this).css({'background-image':'url("../newmaster/images/tubiao-xuanzhong.png")','backgroundColor': '#1d2433'}).siblings('span').css({'background-image':'url("../newmaster/images/liebiao-hui.png")','backgroundColor': '#233044'});
        pagecanshu = index;
    });
    if(pagecanshu == 1){
        $(".L_SX_con ul").hide().eq(1).show();
    }else{
        $(".L_SX_con ul").hide().eq(0).show();
    }
    pagecanshu == 0 ? $(".SX_left span").eq(pagecanshu).css({'background-image':'url("../newmaster/images/liebiao.png")','backgroundColor': '#1d2433'}).siblings('span').css({'background-image':'url("../newmaster/images/tubiao.png")','backgroundColor': '#233044'}) : $(".SX_left span").eq(pagecanshu).css({'background-image':'url("../newmaster/images/tubiao-xuanzhong.png")','backgroundColor': '#1d2433'}).siblings('span').css({'background-image':'url("../newmaster/images/liebiao-hui.png")','backgroundColor': '#233044'});
    function gotopage(types){
        var page = "{{$list->currentPage()}}" ;
        if(types == 0) {
            page = page == 1?page:(Number(page)-Number(1));
        }else{
            var lastpage = "{{$list->lastPage()}}";
            page = page == lastpage?page:(Number(page)+Number(1));
        }
        window.location.href = "{{ URL('/duanweibang?searchname=')  }}"+searchname+"&pagecanshu="+pagecanshu+"&page="+page;
    }


    $(function(){
        // 左侧边栏选中潜力榜
        $('.j_lefNav > ul > li:eq(3)').addClass('active').siblings('li').removeClass('active');
        // 横向列表和块状列表选项卡
        $(".SX_left span").click(function() {
            $(".L_SX_con ul").hide().eq($(this).index()).show();
        });
    })
    // 订阅按钮弹层方法
    var aid       = 0;
    var analyst_username = '';
    var status    = 3;//是否订阅
    var direction = 3;//订阅方向
    // 点击订阅按钮，弹出协议层
    function subfollow(obj){
        var top = $(document).scrollTop();
        $(document).on('scroll.unable',function (e) {
            $(document).scrollTop(top);
        })
        var islogin = "<?php echo Session('eai')['tel']?>";
        if(!islogin){
            //layer.msg('请先<a href="{{ url('/login') }}">登录</a>！');
            showCeng();
            $('#tanCeng>a>button').hide();
            $("#tanCeng").css({'width':'250px','height':'80px','line-height':'80px'}).html('请先<a href="{{ url('/login') }}" style="cursor:pointer;color:#3b9ce0;font-size: 20px;">登录</a>！');
            return false;
        }
        var infofinish = '{{$infofinish}}';
        if(infofinish == 1){
            var gowanshan = "{{url('/authenticate?id=info')}}";
            $('.popUp').hide();
            showCeng();
            $('#tanCeng>a>button').hide();
            $("#tanCeng>span").css({'margin-top':'2px'}).html("您未完善资料，<a href='"+gowanshan+"' style='cursor:pointer;color:#3b9ce0;'>请完善资料!</a>");
            return false;
        }else{
            aid              = $(obj).attr('analyst_id');
            analyst_username = $(obj).attr('analyst_username');
            status           = $(obj).attr('status');
            direction        = $(obj).attr('direction');
            if(this.innerHTML == "订阅") {
                var cancleBtn=$(".foot_right>input");
                cancleBtn.css({"visibility":"hidden"});
            }
            if(this.innerHTML == "编辑订阅") {
                var thisBtn=this;
            }
            if(status == 1){
                $('#gendancancle').show();
            }else{
                $('#gendancancle').hide();
            }
            $('#mask').css({'display':'block'});
            $('#popUp').css({'display':'block'})
        }
    }
    // 点击按钮，关闭层
    $(".close").click(function(){
        $(document).unbind("scroll.unable");
        $('#mask').css({'display':'none'});
        $('#popUp').css({'display':'none'});
    });
    // 遮挡层
    function l_Mask(){
        var div_mask=$('#mask');
        var width=document.body.scrollWidth+'px';
        var height=document.body.scrollHeight+'px';
        div_mask.css({'width':width,'height':height,'display':'block'});
        div_mask.show();
    }
    // 订阅显示
    function showCeng(){
        var div_mask=$('#mask');
        var width=document.body.scrollWidth+'px';
        var height=document.body.scrollHeight+'px';
        div_mask.css({'width':width,'height':height,'display':'block'});
        $('#mask').show();
        $("#tanCeng").show();
    }
    // 订阅隐藏
    function hideCeng(){
        var div_mask=$('#mask');
        var width=document.body.scrollWidth+'px';
        var height=document.body.scrollHeight+'px';
        div_mask.css({'width':width,'height':height,'display':'block'});
        $('#mask').hide();
        $("#tanCeng").hide();
    }
    // 订阅登录提示弹层
    function loginCeng(){
        var div_mask=$('#mask');
        var width=document.body.scrollWidth+'px';
        var height=document.body.scrollHeight+'px';
        div_mask.css({'width':width,'height':height,'display':'block'});
        $('#mask').show();
        $("#tanCeng").show();
        $("#tanCeng > span").html('您未登录,<a href="{{ url('/login') }}" style="color:#3b9ce0">请先登录!</a>');
        $("#tanCeng > button").hide();
        $("#tanCeng").css({'width':'250px','height':'80px','line-height':'80px'});
        $("#tanCeng > span").css({'margin-top':'0'});
    }
</script>
